import type { PageResult } from '@/services/model/baseModel';
import type { BlogPageQuery, BlogVO, HomePageData } from '@/services/model/homePageModel';
import { request } from '@/utils/http';

const BASE_URL = '/api/v1/home-page';

/**
 * 获取主页数据
 */
export function getMainData() {
  return request.Get<HomePageData>(`${BASE_URL}/main-data`);
}

/**
 * 获取热门博客
 */
export function getHotArticle(query: BlogPageQuery) {
  return request.Get<PageResult<BlogVO>>(`${BASE_URL}/hot-article`, {
    params: query,
  });
}
